.class final Lcom/melesta/engine/FacebookOperations$2;
.super Ljava/lang/Object;
.source "FacebookOperations.java"

# interfaces
.implements Lcom/facebook/Request$Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/engine/FacebookOperations;->getUserGameFriends(Ljava/lang/String;II)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic val$callback:I

.field final synthetic val$me:Lcom/melesta/engine/EngineActivity;

.field final synthetic val$user_data:I

.field final synthetic val$user_facebook_id:Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/melesta/engine/EngineActivity;Ljava/lang/String;II)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 131
    iput-object p1, p0, Lcom/melesta/engine/FacebookOperations$2;->val$me:Lcom/melesta/engine/EngineActivity;

    iput-object p2, p0, Lcom/melesta/engine/FacebookOperations$2;->val$user_facebook_id:Ljava/lang/String;

    iput p3, p0, Lcom/melesta/engine/FacebookOperations$2;->val$user_data:I

    iput p4, p0, Lcom/melesta/engine/FacebookOperations$2;->val$callback:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onCompleted(Lcom/facebook/Response;)V
    .locals 12
    .parameter "response"

    .prologue
    const/4 v5, 0x1

    const/4 v9, 0x0

    .line 135
    :try_start_0
    invoke-virtual {p1}, Lcom/facebook/Response;->getError()Lcom/facebook/FacebookRequestError;

    move-result-object v2

    .line 136
    .local v2, facebookError:Lcom/facebook/FacebookRequestError;
    if-eqz v2, :cond_0

    .line 137
    .local v5, isErrorState:Z
    :goto_0
    if-nez v5, :cond_2

    .line 138
    invoke-virtual {p1}, Lcom/facebook/Response;->getGraphObject()Lcom/facebook/model/GraphObject;

    move-result-object v3

    .line 139
    .local v3, graphObject:Lcom/facebook/model/GraphObject;
    if-eqz v3, :cond_5

    .line 140
    const-string v9, "data"

    invoke-interface {v3, v9}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/json/JSONArray;

    .line 141
    .local v0, data:Lorg/json/JSONArray;
    invoke-virtual {v0}, Lorg/json/JSONArray;->length()I

    move-result v6

    .line 142
    .local v6, len:I
    const/4 v9, 0x3

    filled-new-array {v6, v9}, [I

    move-result-object v9

    const-class v10, Ljava/lang/Object;

    invoke-static {v10, v9}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, [[Ljava/lang/Object;

    .line 143
    .local v8, res:[[Ljava/lang/Object;
    const/4 v4, 0x0

    .local v4, i:I
    :goto_1
    if-ge v4, v6, :cond_1

    .line 144
    invoke-virtual {v0, v4}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    .line 145
    .local v7, obj:Lorg/json/JSONObject;
    aget-object v9, v8, v4

    const/4 v10, 0x0

    const-string v11, "uid"

    invoke-virtual {v7, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    aput-object v11, v9, v10

    .line 146
    aget-object v9, v8, v4

    const/4 v10, 0x1

    const-string v11, "name"

    invoke-virtual {v7, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    aput-object v11, v9, v10

    .line 147
    aget-object v9, v8, v4

    const/4 v10, 0x2

    const-string v11, "pic_square"

    invoke-virtual {v7, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    aput-object v11, v9, v10

    .line 143
    add-int/lit8 v4, v4, 0x1

    goto :goto_1

    .end local v0           #data:Lorg/json/JSONArray;
    .end local v3           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v4           #i:I
    .end local v5           #isErrorState:Z
    .end local v6           #len:I
    .end local v7           #obj:Lorg/json/JSONObject;
    .end local v8           #res:[[Ljava/lang/Object;
    :cond_0
    move v5, v9

    .line 136
    goto :goto_0

    .line 150
    .restart local v0       #data:Lorg/json/JSONArray;
    .restart local v3       #graphObject:Lcom/facebook/model/GraphObject;
    .restart local v4       #i:I
    .restart local v5       #isErrorState:Z
    .restart local v6       #len:I
    .restart local v8       #res:[[Ljava/lang/Object;
    :cond_1
    iget-object v9, p0, Lcom/melesta/engine/FacebookOperations$2;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v10, Lcom/melesta/engine/FacebookOperations$2$1;

    invoke-direct {v10, p0, v8}, Lcom/melesta/engine/FacebookOperations$2$1;-><init>(Lcom/melesta/engine/FacebookOperations$2;[[Ljava/lang/Object;)V

    invoke-virtual {v9, v10}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    .line 162
    .end local v0           #data:Lorg/json/JSONArray;
    .end local v3           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v4           #i:I
    .end local v6           #len:I
    .end local v8           #res:[[Ljava/lang/Object;
    :cond_2
    :goto_2
    if-eqz v5, :cond_4

    .line 163
    if-eqz v2, :cond_3

    .line 164
    const-string v9, "engine"

    invoke-virtual {v2}, Lcom/facebook/FacebookRequestError;->getErrorType()Ljava/lang/String;

    move-result-object v10

    invoke-static {v9, v10}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 165
    const-string v9, "engine"

    invoke-virtual {v2}, Lcom/facebook/FacebookRequestError;->getErrorMessage()Ljava/lang/String;

    move-result-object v10

    invoke-static {v9, v10}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 168
    :cond_3
    iget-object v9, p0, Lcom/melesta/engine/FacebookOperations$2;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v10, Lcom/melesta/engine/FacebookOperations$2$2;

    invoke-direct {v10, p0}, Lcom/melesta/engine/FacebookOperations$2$2;-><init>(Lcom/melesta/engine/FacebookOperations$2;)V

    invoke-virtual {v9, v10}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 186
    .end local v2           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v5           #isErrorState:Z
    :cond_4
    :goto_3
    return-void

    .line 158
    .restart local v2       #facebookError:Lcom/facebook/FacebookRequestError;
    .restart local v3       #graphObject:Lcom/facebook/model/GraphObject;
    .restart local v5       #isErrorState:Z
    :cond_5
    const/4 v5, 0x1

    goto :goto_2

    .line 176
    .end local v2           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v3           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v5           #isErrorState:Z
    :catch_0
    move-exception v1

    .line 177
    .local v1, e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V

    .line 178
    iget-object v9, p0, Lcom/melesta/engine/FacebookOperations$2;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v10, Lcom/melesta/engine/FacebookOperations$2$3;

    invoke-direct {v10, p0}, Lcom/melesta/engine/FacebookOperations$2$3;-><init>(Lcom/melesta/engine/FacebookOperations$2;)V

    invoke-virtual {v9, v10}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    goto :goto_3
.end method
